-
Notifications
You must be signed in to change notification settings - Fork 1k
Update c++ compilation standard to 2014 from 2011. #191
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Requires a recent arm toolchain to be used.
Hi @xloem Thanks |
boost::hana is basically the modern way for working with data structures that contain heterogenous types, or types themselves, in a generic way designed for compile-time evaluation. So, for example, I am writing a class to hold an arbitrary block of multidimensional data. The dimensions the data spans may be of different types in the same block (dates of time, sample or sensor indices, positions in space). I'd like to include this information at compile-time so no runtime processing is needed to handle the data. But I'd also like to serialize and deserialize different kinds of these blocks, for storage and communication. I think I can use boost::hana to work with a tuple of dimensions and use either a compiletime set of types, or a runtime dynamic list of runtime type information, without having to worry about how to abstract the difference myself. This would make my C++ code re-usable in both the tuned embedded environment, and in the high-powered database, even though very different assembly and underlying representations are generated. Another use I've considered for boost::hana is to create a compile time expression evaluator that can also function at runtime, allowing things known to be precomputed, but things unknown to be adjusted while the system runs, using hana to work with a complex syntax tree of heterogenous types, objects of which have operator functions to make construction of an expression intuitive for the programmer. ( Boost::Hana is slow to compile, but newer MPL libraries are now in development that compile lightning fast. Upping the standards supported by the compiler will allow newer and newer ways to combine optimization with generalization to be used. |
Here are a couple early examples from the hana manual:
|
Thanks for information. |
I would love if we could upgrade to the C++14 standard, but I think it needs to be done with care. [tldr] add a guideline saying that the core must be compatible with c++11 |
Thanks @lacklustrlabs |
I examined these breaking changes in a little more depth, and I suspect it is reasonable to push forward with c++14 despite them.
Am I wrong about anything here? |
You're right. |
I've performed several builds and tests with this and seen any issue. |
Suggestion: While the compiler.cpp.flags variable is changed, why not make the '-std=gnu++14' flag a variable itself? This way it would be easy to change the -std setting in platform.local.txt without overriding anything else. platform.local.txt: platform.txt:
Without this the entire compiler.cpp.flags variable would have to be modified in platform.local.txt. |
Requires a recent arm toolchain to be used. Based on PR stm32duino#191 proposed by @xloem Updated using @lacklustrlabs suggestion: Make the '-std=gnu++14' flag a variable using 'compiler.cpp.flags' variable. This way it is easy to change the -std setting in platform.local.txt without overriding anything else. platform.local.txt: compiler.cpp.std=gnu++11 Signed-off-by: Frederic Pillon <[email protected]>
Replaced by #196 |
Requires a recent arm toolchain to be used. Based on PR stm32duino#191 proposed by @xloem Updated using @lacklustrlabs suggestion: Make the '-std=gnu++14' flag a variable using 'compiler.cpp.flags' variable. This way it is easy to change the -std setting in platform.local.txt without overriding anything else. platform.local.txt: compiler.cpp.std=gnu++11 Signed-off-by: Frederic Pillon <[email protected]>
Requires a recent arm toolchain to be used.
This allows boost::hana and all sorts of crazy programming techniques.